import { defineStore } from 'pinia'
import type { MenuSetting, ProjectConfig } from '@/types/config'

interface AppState {
  // project config
  projectConfig: ProjectConfig | null
}
export const useAppStore = defineStore('app', {
  state: (): AppState => ({
    projectConfig: {
      menuSetting: {
        siderHidden: false
      }
    },
  }),
  getters: {
    getProjectConfig(state): ProjectConfig {
      return state.projectConfig || ({} as ProjectConfig)
    },
    getMenuSetting(): MenuSetting {
      return this.getProjectConfig.menuSetting
    },
  },
  actions: {
  }
})
